﻿<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title>1.0.User表的增删改</title>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shCore.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushCSharp.js"></script>
    <script type="text/javascript" src="../../Content/highlighter/scripts/shBrushXml.js"></script>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCore.css"/>
    <link type="text/css" rel="stylesheet" href="../../Content/highlighter/styles/shCoreEclipse.css" />
    <script type="text/javascript">SyntaxHighlighter.all();</script>
</head>
<body>
    <h3>1.控制器的定义</h3>
    <p>
        1.控制器类必须以Controller结尾<br />
        2.控制器必须继承自NFinal.OwinAction(Owin框架).或者NFinal.CoreAction(.net core)<br/>
       
        因此在定义控制器时可以使用该默认类型：<br />
        <pre class="brush: csharp;">
        //.net framework 4.0+
        public class BaseController:NFinal.OwinAction
        {
            
        }
        //.net core 1.1或者.net standard 1.4+
        public class BaseController:NFinal.CoreAction
        {
            
        }
        </pre>
        <pre class="brush: csharp;">
        //首页控制器定义
        public class IndexController:BaseController
        {
            public void Index()
            {
                this.Write("Hello Wrold!");
            }
        }
        </pre>
    </p>
</body>
</html>